<%-- 
    Document   : visualizzaEventi
    Created on : 7-lug-2012, 9.24.08
    Author     : Rosario Salone
    Pagina che gestisce la visualizzazione degli eventi ricercati.
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Home ticket two - Visualizza Eventi -</title>
<style type="text/css">
<!--
.Stile3 {
	font-family: "Comic Sans MS", "Monotype Corsiva";
	font-size: 36px;
	color: #FFFFFF;
}
.Stile6 {
	font-size: 36;
	color: #FFFFFF;
}

.Stile7 {
	font-size: 36;
	color:  yellow
}
.Stile8 {font-size: 18px; color: #FFFFFF; }
.Stile27 {font-family: "Comic Sans MS", "Monotype Corsiva"; font-size: 15px; color: #FFCC00; }
.Stile80 {font-family: "Comic Sans MS", "Monotype Corsiva"; font-size: 13px; color: #A6D2FF; }
-->
</style>
</head>

<body>
<table width="804" height="96" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <th width="100" scope="col"><img src="immagini/posta052.gif" width="64" height="77" /></th>
    <th width="700" scope="col"><a href="index.jsp"><img src="immagini/httitolo.jpg" width="700" height="100" /></a></th>
    
  </tr>
</table>

<table width="804" border="0" cellpadding="0" cellspacing="0" bgcolor="#0066CC">
           
  <tr>
    <th width="100" height="181" border="10" rowspan="9" valign="top" scope="col">
        
        <%
        
          if (session.getAttribute("password")==null || session.getAttribute("login")==null){ 


      %>     
                
                <a href="accediUt.jsp"><img src="immagini/Accedi.jpg" width="103" height="50" /></a>
        <a href="registraUtente.jsp"><img src="immagini/Registrati.jpg" width="103" height="50" /></a>
        
        
            
            
        <%} else{
                if (session.getAttribute("verifica")!=null){     
                %>
                <img src="immagini/AreaAmmini3.jpg" width="103" height="50" />
                <a href="aggiungiEvento.jsp"><img src="immagini/AggEv.jpg" width="103" height="50" /></a>
            <a href="nonImplementato.jsp"><img src="immagini/RimUt.jpg" width="103" height="50" /></a>
            <a href="cancellaUtente.jsp"><img src="immagini/CanUt.jpg" width="103" height="50" /></a>

        
        <%}else
        {                                          
         %> 
              <img src="immagini/AreaGest.jpg" width="103" height="50" />
              <a href="accessoPrenot.jsp"><img src="immagini/prenotazioni_1.jpg" width="103" height="50" /></a>
                <a href="modificaUtente.jsp"><img src="immagini/ModificaD.jpg" width="103" height="50" /></a>
            
           
            
            <a href="cancellaUtente.jsp"><img src="immagini/CanUt.jpg" width="103" height="50" /></a>                        
                  <%}
                
      
                %> 
                
                              &nbsp;&nbsp;
          <form id="form1" name="form1" method="post" action="Controller">
          <input type="hidden" value="logOut" name="provenienza" />
          <input type="submit" value="log out" name="logOut" />
          
          </form>
<%} %>

     </th>
              <th rowspan="6" align="center" valign="middle" scope="col"><form id="form1" name="form1" method="post" action="Controller">
     
      <p class="Stile3">Eventi Disponibili</p>
       
        <table width="600" border="1" cellspacing="0" cellpadding="0">
          <tr><!--questa rimane così com'è!! -->
            <th width="52" height="23" bordercolor="#333333" scope="col"><span class="Stile27">codice</span></th>
            <th width="89" bordercolor="#333333" scope="col"><span class="Stile27">nome</span></th>
            <th width="37" bordercolor="#333333" scope="col"><span class="Stile27">tipo</span></th>
            <th width="76" bordercolor="#333333" scope="col"><span class="Stile27">luogo</span></th>
            <th width="86" bordercolor="#333333" scope="col"><span class="Stile27">data</span></th>
            <th width="49" bordercolor="#333333" scope="col"><span class="Stile27">ora</span></th>
            <th width="55" bordercolor="#333333" scope="col"><span class="Stile27">posti</span></th>
            <th width="78" bordercolor="#333333" scope="col"><span class="Stile27">prezzo($)</span></th>
            
			<th width="55" bordercolor="#333333" scope="col"><span class="Stile27">scegli</span></th>
          </tr>
          
          <!-- questa cambia-->
      
             <%ejb.Evento ev;
             if(request.getAttribute("errore")!=null){
                if(request.getAttribute("errore").equals("just")) {
             %><font size =+3 color=red> Attenzione! </font><br/>
             <span class="Stile7">Evento già prenotato, ricerca un altro evento o annulla la prenotazione,<br/> NON saranno effettuati rimborsi</span> <%
                request.setAttribute("errore","null");}
                 
             }
            else if (request.getAttribute("listaEventi")==null) {%> 
              <tr><font size =+3 color=red> ERRORE!!!!!!!! </font></tr>
             <% } else {
                java.util.List listaEv = ((java.util.List) request.getAttribute("listaEventi")) ;
                java.util.List listaViag = ((java.util.List) request.getAttribute("listaViaggio")) ;
                if (listaEv.size()==0) 
                {%><tr>
                <font face=comic size =+2 color=red>... Nessun evento ...</font> </tr>  
                
                <%
             } else { 
                 int i;               
                for (i=0;i<listaEv.size();i++) 
                { ev = (ejb.Evento) listaEv.get(i); %>    
                <tr>
                   <td height="36" align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getCod()%></span></td>
                   <td align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getNome()%></span></td>
                   <td align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getTipo()%></span></td>
                   <td align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getLuogo()%></span></td>
                   <td align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getDataevento()%></span></td>
                   <td align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getOra()%></span></td>
                   <td align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getPosti()%></span></td>
                   <td align="center" bordercolor="#333333"><span class="Stile80"><%=ev.getPrezzo()%></span></td>
			<td align="center" bordercolor="#333333"><span class="Stile80">
			  <label>
		      <input name="rad" type="radio" value="<%=ev.getCod()%>">
		      </label>
			  </span></td>
          </tr>
          <% }}} %>
        </table>
        <p class="Stile8">&nbsp;</p>
        <p>
          <label>
             <input type="hidden" name="provenienza" value="visualizzaEventi"/>
          <input type="submit" name="Submit" value="Prenota!! ">
          </label>
        </p></form>
      <th width="100" valign="top" bordercolor="#ECE9D8" bgcolor="#FFFFFF" scope="col"><img src="immagini/elenco.jpg" width="100" height="400" /></th>
</table>
</body>
</html>